<?php
/**
 * Created by JetBrains PhpStorm.
 * User: scala
 * Date: 12-10-27
 * Time: 上午12:44
 * To change this template use File | Settings | File Templates.
 */
class StaffArticleModel extends CommonModel
{
    protected $_validate=array(
        array('title','require','请输入文章标题！'),
        array('indexcontent','require','请输入文章索引！'),
        array('maincontent','require','请输入正文！'),
    );





    protected $_auto=array(
        array("createtime","time",Model::MODEL_INSERT,"function"),
        array("author","getMemberId",Model::MODEL_BOTH,"callback"),
    );


    function genAuthor(){
        import("ORG.Util.Session");
        if(Session::is_set(C("USER_AUTH_KEY"))){
            return Session::get(C("USER_AUTH_KEY"));
        }else{
            return 0;
        }
    }
}
